﻿/**
 * slj
 * Loading缓冲页面
 */

class Loading extends UiFramework.UiAbstract {
    onStart(divSelf: HTMLDivElement) {

        
        let txtTitle = document.createElement("text");
        txtTitle.innerText = "读取中。。。。";
        txtTitle.style.position = "absolute";
        txtTitle.style.top = "20%";
        txtTitle.style.left = "45%";
        txtTitle.style.height = "50%";
        this.divSelf.appendChild(txtTitle);

        
        let btnLogin1 = document.createElement("input");
        btnLogin1.type = "button";
        btnLogin1.value = "读取成功进入配置列表";
        btnLogin1.style.top = "30%";
        this.divSelf.appendChild(btnLogin1);

        
        let btnLogin2 = document.createElement("input");
        btnLogin2.type = "button";
        btnLogin2.value = "读取失败弹出弹框";
        btnLogin2.style.top = "40%";
        this.divSelf.appendChild(btnLogin2);


        //读取成功的跳转
        btnLogin1.onclick = () => {
            this.finish();
            this.stateMgr.changeStateByName("configureDetailsUI");
            
        }

        //读取失败弹出框
        btnLogin2.onclick = () => {
            this.openDialog("addHostFailureDialog", () => {
                //此处是点击取消按钮的接口回调
                this.finish();
            });
        }

        
    }

    onEnd() {

    }
}

//  界面管理
UiMap["loading"] = () => {
    return new Loading();
}